export function debounce (fn: (...params: any[]) => void, delay: number) {
  let timer: any
  return function (...args: string[]) {
    const context = this
    if (timer) clearTimeout(timer)
    timer = setTimeout(() => {
      fn.apply(context, args)
    }, delay)
  }
}
